package com.yuyou.fn.tms.vo;

import com.yuyou.fn.educational.entity.Student;
import com.yuyou.fn.platform.entity.City;
import com.yuyou.fn.platform.entity.District;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by lzh on 2019/1/24.
 */
public class TmsStudent {

    static Map<Integer,Integer> sexMap=new HashMap<>();
    static {
        sexMap.put(1,0);
        sexMap.put(2,1);
    }

    @ApiModelProperty("主键id")
    private Long stuId ;//主键id

    @ApiModelProperty("学生姓名")
    private String stuName ;//学生姓名

    @ApiModelProperty("会员（CID）id")
    private String stuMemberId ;//会员（CID）id

    @ApiModelProperty("性别（0：男；1：女）")
    private Integer sex ;//性别（0：男；1：女）

    @ApiModelProperty("短信号码(1--学员2--父亲3--母亲)")
    private Integer stuSMSNumber ;//短信号码(1--学员2--父亲3--母亲)

    @ApiModelProperty("学员手机")
    private String stuStudentPhone ;//学员手机

    @ApiModelProperty("父亲手机")
    private String stuFatherPhone ;//父亲手机

    @ApiModelProperty("母亲手机")
    private String stuMotherPhone ;//母亲手机

    @ApiModelProperty("家庭住址城市id")
    private Long cityId ;//家庭住址城市id

    @ApiModelProperty("家庭住址市名")
    private String cityName ;//家庭住址市名

    @ApiModelProperty("家庭住址区id")
    private Long masId ;//家庭住址区id

    @ApiModelProperty("家庭住址区名")
    private String masName ;//家庭住址区名

    @ApiModelProperty("家庭住址详情")
    private String stuAddressDetails ;//家庭住址详情

    @ApiModelProperty("就读年级ID")
    private Long tbgId ;//就读年级ID

    @ApiModelProperty("就读年级名称")
    private String tbgName ;//就读年级名称

    @ApiModelProperty("创建时间")
    private Date stuCreateTime ;//创建时间

    @ApiModelProperty("修改时间")
    private Date stuModifyTime ;//修改时间

    @ApiModelProperty("学生编号")
    private String stuNumber ;//学生编号

    @ApiModelProperty("就读学校")
    private String fsName ;//就读学校

    @ApiModelProperty("就读学校id")
    private Long fsId ;//就读学校id

    @ApiModelProperty("出生日期（yyyy-mm-dd）")
    private Date stuBirthDay ;//出生日期（yyyy-mm-dd）

    @ApiModelProperty("推荐人id")
    private Long referrerId ;//推荐人id

    @ApiModelProperty("推荐人")
    private String referrerName	;//	推荐人

    @ApiModelProperty("备注")
    private String stuRemark;   //	备注


    public TmsStudent(Student student, City city, District district){
        this.setStuId(student.getStudentId());//主键id
        this.setStuName(student.getName());//学生姓名
        this.setStuMemberId(student.getCid());//会员（CID）id
        this.setSex(sexMap.get(student.getSex()));//性别（0：男；1：女）
        this.setStuSMSNumber(1);//短信号码(1--学员2--父亲3--母亲)
        this.setStuStudentPhone(student.getPhoneNo());//学员手机
        this.setStuFatherPhone(null);//父亲手机
        this.setStuMotherPhone(null);//母亲手机
        if (city!=null){
            this.setCityId(city.getCityId());//家庭住址城市id
            this.setCityName(city.getCityName());//家庭住址市名
        }
        if (district!=null){
            this.setMasId(district.getDistrictId());//家庭住址区id
            this.setMasName(district.getDistrictName());//家庭住址区名
        }

        this.setStuAddressDetails(student.getAddress());//家庭住址详情
        this.setTbgId(student.getGradeId());//就读年级ID
        this.setTbgName(student.getGradeName());//就读年级名称
        this.setStuCreateTime(student.getCreateTime());//创建时间
        this.setStuModifyTime(student.getUpdateTime());//修改时间
        this.setStuNumber(student.getStudentNo());//学生编号
        this.setFsName(student.getSchool());//就读学校
        this.setFsId(null);//就读学校id
        this.setStuBirthDay(student.getBirthday());//出生日期（yyyy-mm-dd）
        this.setReferrerId(student.getReferrerId());//推荐人id
        this.setReferrerName(student.getReferrerName());
        this.setStuRemark(student.getRemark());
    }

    public Long getStuId() {
        return stuId;
    }

    public void setStuId(Long stuId) {
        this.stuId = stuId;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public String getStuMemberId() {
        return stuMemberId;
    }

    public void setStuMemberId(String stuMemberId) {
        this.stuMemberId = stuMemberId;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getStuSMSNumber() {
        return stuSMSNumber;
    }

    public void setStuSMSNumber(Integer stuSMSNumber) {
        this.stuSMSNumber = stuSMSNumber;
    }

    public String getStuStudentPhone() {
        return stuStudentPhone;
    }

    public void setStuStudentPhone(String stuStudentPhone) {
        this.stuStudentPhone = stuStudentPhone;
    }

    public String getStuFatherPhone() {
        return stuFatherPhone;
    }

    public void setStuFatherPhone(String stuFatherPhone) {
        this.stuFatherPhone = stuFatherPhone;
    }

    public String getStuMotherPhone() {
        return stuMotherPhone;
    }

    public void setStuMotherPhone(String stuMotherPhone) {
        this.stuMotherPhone = stuMotherPhone;
    }

    public Long getCityId() {
        return cityId;
    }

    public void setCityId(Long cityId) {
        this.cityId = cityId;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public Long getMasId() {
        return masId;
    }

    public void setMasId(Long masId) {
        this.masId = masId;
    }

    public String getMasName() {
        return masName;
    }

    public void setMasName(String masName) {
        this.masName = masName;
    }

    public String getStuAddressDetails() {
        return stuAddressDetails;
    }

    public void setStuAddressDetails(String stuAddressDetails) {
        this.stuAddressDetails = stuAddressDetails;
    }

    public Long getTbgId() {
        return tbgId;
    }

    public void setTbgId(Long tbgId) {
        this.tbgId = tbgId;
    }

    public String getTbgName() {
        return tbgName;
    }

    public void setTbgName(String tbgName) {
        this.tbgName = tbgName;
    }

    public Date getStuCreateTime() {
        return stuCreateTime;
    }

    public void setStuCreateTime(Date stuCreateTime) {
        this.stuCreateTime = stuCreateTime;
    }

    public Date getStuModifyTime() {
        return stuModifyTime;
    }

    public void setStuModifyTime(Date stuModifyTime) {
        this.stuModifyTime = stuModifyTime;
    }

    public String getStuNumber() {
        return stuNumber;
    }

    public void setStuNumber(String stuNumber) {
        this.stuNumber = stuNumber;
    }

    public String getFsName() {
        return fsName;
    }

    public void setFsName(String fsName) {
        this.fsName = fsName;
    }

    public Long getFsId() {
        return fsId;
    }

    public void setFsId(Long fsId) {
        this.fsId = fsId;
    }

    public Date getStuBirthDay() {
        return stuBirthDay;
    }

    public void setStuBirthDay(Date stuBirthDay) {
        this.stuBirthDay = stuBirthDay;
    }

    public Long getReferrerId() {
        return referrerId;
    }

    public void setReferrerId(Long referrerId) {
        this.referrerId = referrerId;
    }

    public String getReferrerName() {
        return referrerName;
    }

    public void setReferrerName(String referrerName) {
        this.referrerName = referrerName;
    }

    public String getStuRemark() {
        return stuRemark;
    }

    public void setStuRemark(String stuRemark) {
        this.stuRemark = stuRemark;
    }
}
